﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Windows.Forms;
using System.Web;

namespace HYQuick
{
    internal static class HYQuickVitality
    {
        public static void UpdateVitality(String action,String target,String api)
        {
#if !DEBUG
            Action update = () =>
              {
                  action = HttpUtility.UrlEncode(action);//对Url字符串进行解码
                target = HttpUtility.UrlEncode(target);
                  api = HttpUtility.UrlEncode(api);

                  HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(String.Format(HYQuickMultiVersion.s_vitalityRequest, action, target, api));
                  try
                  {
                      request.Method = "GET";
                      request.UserAgent = "HYQuick" + Application.ProductVersion;
                      request.BeginGetRequestStream(null, null); //只需要异步，无需知道结果
                }
                  catch { }
              };
            update.BeginInvoke(null,null);
#endif
        }
    }
}
